﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Blizzard.Contracts;
using Blizzard.Interceptors;

namespace Blizzard.Test.DataObjectsII
{

    [MapperAttribute(Table="[DataObjectsII A]")]
   public class A : IDataObject
    {
        private Interceptor _interceptor;
        [MapperAttribute(Field="[MY ID]", IsIdentityColumn=true)]
        public int Id { get; set; }

        private string _name;
        [Mapper(Field = "Name")]
        public string Name
        {
            get
            {
                _interceptor.Intercept(this, "Name", false);
                return _name;
            }
            set
            {
                _interceptor.Intercept(this, "Name", true, _name, value);
                _name = value;
            }
        }


        private BList<B> _bees;
        public BList<B> bees
        {
            get 
            {
                _interceptor.Intercept(this, "bees", false);
                return _bees; 
            }
            set 
            {
                _interceptor.Intercept(this, "bees", true, _bees, value);
                _bees = value; 
            }
        }


        private BList<BB> _bbees;
        public BList<BB> bbees
        {
            get
            {
                _interceptor.Intercept(this, "bbees", false);
                return _bbees;
            }
            set
            {
                _interceptor.Intercept(this, "bbees", true, _bbees, value);
                _bbees = value;
            }
        }

        private BList<BBB> _bbbees;
        public BList<BBB> bbbees
        {
            get
            {
                _interceptor.Intercept(this, "bbbees", false);
                return _bbbees;
            }
            set
            {
                _interceptor.Intercept(this, "bbbees", true, _bbbees, value);
                _bbbees = value;
            }
        }

        private BList<BBBB> _bbbbees;
        public BList<BBBB> bbbbees
        {
            get
            {
                _interceptor.Intercept(this, "bbbbees", false);
                return _bbbbees;
            }
            set
            {
                _interceptor.Intercept(this, "bbbbees", true, _bbbbees, value);
                _bbbbees = value;
            }
        }
        
     
        public Container.BlizzardManager Manager
        {
            set { _interceptor = new Interceptor(value); }
        }
    }
}
